
export default function lossDetailReducer(state = {
        fetching: true,
        lossTypes: null,
        subLossTypes: null,
        selectLossType: null,
        selectSubLossType: null,
        lodging: false}, action) {
    switch (action.type) {
        case 'init-lossTypes':
            return {
                ...state,
                lossTypes: action.payload,
                fetching: false
            }
        case 'select-ossTypes':
            return {
                ...state,
                subLossTypes: action.payload,
                selectLossType: action.selectLossType,
                fetching: false
            }
        case 'select-subLossType':
            return {
                ...state,
                selectSubLossType: action.payload,
                fetching: false
            }
        case 'lodge-success':
            return {
                ...state,
                claimNumber: action.payload
            }
        case 'fetching':
            return {
                ...state,
                fetching: action.payload
            }
        default:
            return state;
    }
}

